<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>滴答办公系统-班级修改</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="media/layui/css/layui.css" media="all">
<script type="text/javascript" src="media/js/jquery.min.js"></script>
<script src="media/layui/layui.js"></script>
<script type="text/javascript">
$(function () {
	//获取请求参数
	var json=getData();
	//解码参数值并解析json
	//console.log(decodeURI(json));
	var obj=JSON.parse(decodeURI(json));
	//显示数据
	showData(obj);
})
//获取传递的参数信息
function getData() {
	var url=window.location.search;
	index=url.indexOf("?");
	if(index>-1){
		var str = url.substr(index+1);
		if(str.indexOf('=')){
			return str.split('=')[1];
		}
	}
	return null;
}
//显示数据
function showData(obj) {
	$("#f1").val(obj.id);
	$("#f2").val(obj.name);
	$("#f3").val(obj.cname);
	$("#f4").val(obj.createdate);
	$("#f5").val(obj.week);
	$("#f6").val(obj.location);
}
</script>
</head>
<body>

	<div class="layui-container" style="margin-top: 5px">
		<form class="layui-form" action="gradeupdate.do" method="post">
		<div class="layui-form-item">
				<label class="layui-form-label">班级序号</label>
				<div class="layui-input-block">
					<input type="text" name="id" readonly="readonly" autocomplete="off"
						class="layui-input" id="f1">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">班级名称</label>
				<div class="layui-input-block">
					<input type="text" name="name" id="f2" lay-verify="name" autocomplete="off"
						placeholder="请输入名称" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">班级学科</label>
				<div class="layui-input-block">
					<input type="text" id="f3" lay-verify="name" autocomplete="off"
						readonly="readonly" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">开班日期</label>
				<div class="layui-input-block">
				 <input type="text" readonly="readonly" id="f4" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">班级周期</label>
				<div class="layui-input-block">
					<input type="text" name="week" id="f5" lay-verify="name" autocomplete="off"
						placeholder="请输入周期" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">班级地址</label>
				<div class="layui-input-block">
					<input type="text" name="location" id="f6" lay-verify="name" autocomplete="off"
						placeholder="请输入地址" class="layui-input">
				</div>
			</div>
			
		
			<div class="layui-form-item">
				<input class="layui-btn"  style="margin-left: 10%"  type="submit" value="确认修改">
			</div>
		</form>
	</div>
	
	<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
	<script>
		layui.use([ 'form', 'laydate' ],
						function() {
							var form = layui.form, layer = layui.layer, laydate = layui.laydate;

		});
	</script>
</body>
</html>